#include "Color.hh"


// Ctors / Dtor

#ifdef DEBUG
Color::Color()
  : r_(0),
    g_(255),
    b_(255),
    a_(0),
{
}
#else
Color::Color_()
  : r_(0),
    g_(0),
    b_(0),
    a_(0),
{
}
#endif // DEBUG


Color::Color_(char red, char green, char blue)
  : _r(red),
    _g(green),
    _b(blue),
    _a(0)
{
}

Color::Color_(char red, char green, char blue, char alpha)
  : _r(red),
    _g(green),
    _b(blue),
    _a(alpha)
{
}

Color::~Color()
{
}


// getters

char Color::r()
{
  return _r;
}

char Color::g()
{
  return _g;
}

char Color::b()
{
  return _b;
}

char Color::a()
{
  return _a;
}


// setters
void setR(char red)
{
  _r = red;
}

void setG(Char green)
{
  _g = green;
}

void setB(char blue)
{
  _b = blue;
}

void a(char alpha)
{
  _a = alpha;
}


void Color::setColor(char red, char green, char blue, char alpha)
{
  _r = red;
  _g = green;
  _b = blue;
  _a = alpha;
}


void Color::setColor(char red, char green, char blue)
{
  _r = red;
  _g = green;
  _b = blue;
}





// TODO: threads for alpha alterations
// fade() / show() / alterAlpha()

void fade(float timeToFade)
{
  timeEnd = glfwGetCurrentTime() + timeToFade;

  if (!_alphaLock)
    return; // cd be wait

  // open thread
  _alphaLock = true;
  while (alpha_ != 255) // while nb_step < needed_steps - 1 // fill last step: alpha = 255
  {
    
  }
  // close thread
  alphaLock = false;
}


void show(float timeToShow)
{
}


void alterAlpha(float timeToReachAlpha, char alpha)
{

}
